package com.briup.cms.bean;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.*;

import com.briup.cms.util.excel.CategoryParentIdConverter;
import com.briup.cms.util.excel.DeletedConverter;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;

/**
 * @TableName cms_category
 */
@TableName(value ="cms_category")
@Data
public class Category{
    @TableId(type = IdType.AUTO)
    @JsonSerialize(using = ToStringSerializer.class)
    @ExcelIgnore
    private Integer id;
    /**
     * 栏目名称
     */
    @ExcelProperty("栏目名称")
    private String name;
    /**
     * 栏目描述
     */
    @ExcelProperty("栏目描述")
    private String description;
    /**
     * 栏目序号
     */
    @ExcelProperty(value = "栏目序号")
    private Integer orderNum;
    /**
     * 栏目删除状态
     */
    @TableLogic
    @ExcelProperty(value = "栏目删除状态", converter = DeletedConverter.class)
    private Integer deleted;
    /**
     * 父栏目id
     */
    @ExcelProperty(value = "父栏目", converter = CategoryParentIdConverter.class)
    private Integer parentId;

    public Category(String name) {
        this.name = name;
    }
}